/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb010_lote_remessa")
@NamedQueries({
    @NamedQuery(name = "LoteRemessa.findByNuCnpjPref", query = "SELECT lr FROM LoteRemessa lr WHERE lr.nuCnpjPref.nuCnpjPref = :pNuCnpjPref")})
public class LoteRemessa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_INTERFACE")
    private Integer nuSqnclInterface;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_LOTE")
    private int nuLote;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_REMESSA")
    private short nuRemessa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_APF")
    private int nuApf;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_DV_APF")
    private short nuDvApf;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DT_GERACAO")
    @Temporal(TemporalType.DATE)
    private Date dtGeracao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HH_GERACAO")
    @Temporal(TemporalType.TIME)
    private Date hhGeracao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DT_PROCESSAMENTO")
    @Temporal(TemporalType.DATE)
    private Date dtProcessamento;
    @Basic(optional = false)
    @NotNull
    @Column(name = "QT_REGISTROS")
    private int qtRegistros;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SITUACAO")
    private short nuSituacao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TS_PROCESSAMENTO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date tsProcessamento;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IC_POSICAO")
    private char icPosicao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IC_EMITIDO")
    private char icEmitido;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_PRAZO_IMPRSO")
    private short nuPrazoImprso;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DT_GRCO_RLTRO")
    @Temporal(TemporalType.DATE)
    private Date dtGrcoRltro;
    @JoinColumn(name = "NU_CNPJ_PREF", referencedColumnName = "NU_CNPJ_PREF")
    @ManyToOne(optional = false)
    private Prefeitura nuCnpjPref;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nuSqnclInterface")
    private List<Inscricao> inscricaoList;

    public LoteRemessa() {
    }

    public LoteRemessa(Integer nuSqnclInterface) {
        this.nuSqnclInterface = nuSqnclInterface;
    }

    public LoteRemessa(int nuLote, short nuRemessa, int nuApf, short nuDvApf) {
        this.nuLote = nuLote;
        this.nuRemessa = nuRemessa;
        this.nuApf = nuApf;
        this.nuDvApf = nuDvApf;
    }
        
    public LoteRemessa(Integer nuSqnclInterface, int nuLote, short nuRemessa, int nuApf, short nuDvApf, Date dtGeracao, Date hhGeracao, Date dtProcessamento, int qtRegistros, short nuSituacao, Date tsProcessamento, char icPosicao, char icEmitido, short nuPrazoImprso, Date dtGrcoRltro) {
        this.nuSqnclInterface = nuSqnclInterface;
        this.nuLote = nuLote;
        this.nuRemessa = nuRemessa;
        this.nuApf = nuApf;
        this.nuDvApf = nuDvApf;
        this.dtGeracao = dtGeracao;
        this.hhGeracao = hhGeracao;
        this.dtProcessamento = dtProcessamento;
        this.qtRegistros = qtRegistros;
        this.nuSituacao = nuSituacao;
        this.tsProcessamento = tsProcessamento;
        this.icPosicao = icPosicao;
        this.icEmitido = icEmitido;
        this.nuPrazoImprso = nuPrazoImprso;
        this.dtGrcoRltro = dtGrcoRltro;
    }

    public Integer getNuSqnclInterface() {
        return nuSqnclInterface;
    }

    public void setNuSqnclInterface(Integer nuSqnclInterface) {
        this.nuSqnclInterface = nuSqnclInterface;
    }

    public int getNuLote() {
        return nuLote;
    }

    public void setNuLote(int nuLote) {
        this.nuLote = nuLote;
    }

    public short getNuRemessa() {
        return nuRemessa;
    }

    public void setNuRemessa(short nuRemessa) {
        this.nuRemessa = nuRemessa;
    }

    public int getNuApf() {
        return nuApf;
    }

    public void setNuApf(int nuApf) {
        this.nuApf = nuApf;
    }

    public short getNuDvApf() {
        return nuDvApf;
    }

    public void setNuDvApf(short nuDvApf) {
        this.nuDvApf = nuDvApf;
    }

    public Date getDtGeracao() {
        return dtGeracao;
    }

    public void setDtGeracao(Date dtGeracao) {
        this.dtGeracao = dtGeracao;
    }

    public Date getHhGeracao() {
        return hhGeracao;
    }

    public void setHhGeracao(Date hhGeracao) {
        this.hhGeracao = hhGeracao;
    }

    public Date getDtProcessamento() {
        return dtProcessamento;
    }

    public void setDtProcessamento(Date dtProcessamento) {
        this.dtProcessamento = dtProcessamento;
    }

    public int getQtRegistros() {
        return qtRegistros;
    }

    public void setQtRegistros(int qtRegistros) {
        this.qtRegistros = qtRegistros;
    }

    public short getNuSituacao() {
        return nuSituacao;
    }

    public void setNuSituacao(short nuSituacao) {
        this.nuSituacao = nuSituacao;
    }

    public Date getTsProcessamento() {
        return tsProcessamento;
    }

    public void setTsProcessamento(Date tsProcessamento) {
        this.tsProcessamento = tsProcessamento;
    }

    public char getIcPosicao() {
        return icPosicao;
    }

    public void setIcPosicao(char icPosicao) {
        this.icPosicao = icPosicao;
    }

    public char getIcEmitido() {
        return icEmitido;
    }

    public void setIcEmitido(char icEmitido) {
        this.icEmitido = icEmitido;
    }

    public short getNuPrazoImprso() {
        return nuPrazoImprso;
    }

    public void setNuPrazoImprso(short nuPrazoImprso) {
        this.nuPrazoImprso = nuPrazoImprso;
    }

    public Date getDtGrcoRltro() {
        return dtGrcoRltro;
    }

    public void setDtGrcoRltro(Date dtGrcoRltro) {
        this.dtGrcoRltro = dtGrcoRltro;
    }

    public Prefeitura getNuCnpjPref() {
        return nuCnpjPref;
    }

    public void setNuCnpjPref(Prefeitura nuCnpjPref) {
        this.nuCnpjPref = nuCnpjPref;
    }

    public List<Inscricao> getInscricaoList() {
        return inscricaoList;
    }

    public void setInscricaoList(List<Inscricao> inscricaoList) {
        this.inscricaoList = inscricaoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclInterface != null ? nuSqnclInterface.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LoteRemessa)) {
            return false;
        }
        LoteRemessa other = (LoteRemessa) object;
        if ((this.nuSqnclInterface == null && other.nuSqnclInterface != null) || (this.nuSqnclInterface != null && !this.nuSqnclInterface.equals(other.nuSqnclInterface))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.LoteRemessa[ nuSqnclInterface=" + nuSqnclInterface + " ]";
    }
    
}
